home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / etc / udev / rules.d / 50-udev.rules < prev    next >
Text File  |  2006-05-02  |  12KB  |  309 lines

  1. # /etc/udev/rules/50-udev.rules:  device naming rules for udev
  2. #
  3. # Gentoo specific rules
  4. #
  5. # There are a number of modifiers that are allowed to be used in some of the
  6. # fields.  See the udev man page for a full description of them.
  7. #
  8. # Try not to modify this file, if you wish to change things, create a new rule
  9. # file that can be run before this one.
  10. #
  11.  
  12.  
  13. # console
  14. KERNEL=="pty[pqrstuvwxyzabcdef][0123456789abcdef]", NAME="%k", GROUP="tty",    OPTIONS="last_rule"
  15. KERNEL=="tty[pqrstuvwxyzabcdef][0123456789abcdef]", NAME="%k", GROUP="tty",    OPTIONS="last_rule"
  16. KERNEL=="vcs*",                 NAME="%k", GROUP="tty",            OPTIONS="last_rule"
  17. KERNEL=="vcsa*",                NAME="%k", GROUP="tty",            OPTIONS="last_rule"
  18. KERNEL=="tty",                  NAME="%k", GROUP="tty", MODE="0666",    OPTIONS="last_rule"
  19. KERNEL=="tty[0-9]",             NAME="%k", GROUP="tty",            OPTIONS="last_rule"
  20. KERNEL=="tty[0-9][0-9]",        NAME="%k", GROUP="tty",            OPTIONS="last_rule"
  21. KERNEL=="console",        NAME="%k", GROUP="tty", MODE="0600"
  22. KERNEL=="ptmx",            NAME="%k", GROUP="tty", MODE="0666"
  23.  
  24. # tty devices
  25. KERNEL=="ttyS[0-9]*",    NAME="%k", SYMLINK="tts/%n", GROUP="tty"
  26. KERNEL=="ttyUSB[0-9]*",    NAME="%k", SYMLINK="tts/USB%n", GROUP="tty", MODE="0660"
  27. KERNEL=="ippp0",    NAME="%k", GROUP="tty"
  28. KERNEL=="isdn*"        NAME="%k", GROUP="tty"
  29. KERNEL=="dcbri*",    NAME="%k", GROUP="tty"
  30. KERNEL=="ircomm*",    NAME="%k", GROUP="tty"
  31.  
  32. # all block devices
  33. SUBSYSTEM=="block", GROUP="disk"
  34.  
  35. # cdrom symlinks and other good cdrom naming
  36. BUS=="ide",    KERNEL=="hd[a-z]", ACTION=="add", IMPORT="/sbin/cdrom_id --export $tempnode"
  37. BUS=="scsi",    KERNEL="sr[0-9]*", ACTION=="add", IMPORT="/sbin/cdrom_id --export $tempnode"
  38. BUS=="scsi",    KERNEL="scd[a-z]", ACTION=="add", IMPORT="/sbin/cdrom_id --export $tempnode"
  39. BUS=="scsi",    KERNEL="sg[0-9]*", ACTION=="add", DRIVER=="sr", GROUP="cdrom"
  40. ENV{ID_CDROM}=="?*",        SYMLINK+="cdrom%e", GROUP="cdrom"
  41. ENV{ID_CDROM_CD_RW}=="?*",    SYMLINK+="cdrw%e"
  42. ENV{ID_CDROM_DVD}=="?*",    SYMLINK+="dvd%e"
  43. ENV{ID_CDROM_DVD_R}=="?*",    SYMLINK+="dvdrw%e"
  44.  
  45. # disk devices
  46. KERNEL=="sd*",        NAME="%k", GROUP="disk"
  47. KERNEL=="dasd*",    NAME="%k", GROUP="disk"
  48. KERNEL=="ataraid*",    NAME="%k", GROUP="disk"
  49.  
  50. # compaq smart array
  51. KERNEL=="cciss*",    PROGRAM="raid-devfs.sh %k", NAME="%c{1}", SYMLINK+="%k"
  52. KERNEL=="ida*",        PROGRAM="raid-devfs.sh %k", NAME="%c{1}", SYMLINK+="%k"
  53.  
  54. # mylex
  55. KERNEL=="rd*",        PROGRAM="raid-devfs.sh %k", NAME="%c{1}", SYMLINK+="%k"
  56.  
  57. # dri devices
  58. KERNEL=="card*",    NAME="dri/card%n", GROUP="video"
  59. KERNEL=="nvidia*",    NAME="%k", GROUP="video"
  60. KERNEL=="3dfx*",    NAME="%k", GROUP="video"
  61.  
  62. # alsa devices
  63. SUBSYSTEM=="sound", GROUP="audio"
  64. KERNEL=="controlC[0-9]*",    NAME="snd/%k"
  65. KERNEL=="hw[CD0-9]*",        NAME="snd/%k"
  66. KERNEL=="pcm[CD0-9cp]*",    NAME="snd/%k"
  67. KERNEL=="midiC[D0-9]*",        NAME="snd/%k"
  68. KERNEL=="timer",        NAME="snd/%k"
  69. KERNEL=="seq",            NAME="snd/%k"
  70.  
  71. # capi devices
  72. KERNEL=="capi",        NAME="capi20", SYMLINK+="isdn/capi20", GROUP="dialout"
  73. KERNEL=="capi*",    NAME="capi/%n", GROUP="dialout"
  74.  
  75. # cpu devices
  76. KERNEL=="cpu[0-9]*",    NAME="cpu/%n/cpuid"
  77. KERNEL=="msr[0-9]*",    NAME="cpu/%n/msr"
  78. KERNEL=="microcode",    NAME="cpu/microcode"
  79.  
  80. # dm devices (ignore them)
  81. KERNEL=="dm-[0-9]*",    OPTIONS="ignore_device"
  82. # create a symlink named after the device map name
  83. # note devmap_name comes with extras/multipath
  84. #KERNEL=="dm-[0-9]*",    PROGRAM="/sbin/devmap_name %M %m", NAME="%k", SYMLINK+="%c"
  85. KERNEL=="device-mapper",    NAME="mapper/control"
  86.  
  87. # fb devices
  88. KERNEL=="fb[0-9]*",    NAME="fb/%n", SYMLINK+="%k", GROUP="video"
  89.  
  90. # floppy devices
  91. KERNEL=="fd[0-9]*",    NAME="floppy/%n", SYMLINK+="%k", GROUP="floppy"
  92.  
  93. # i2c devices
  94. KERNEL=="i2c-[0-9]*",    NAME="i2c/%n", SYMLINK+="%k"
  95.  
  96. # input devices
  97. KERNEL=="mice",        NAME="input/%k", MODE="0644"
  98. KERNEL=="mouse*",    NAME="input/%k", MODE="0644"
  99. KERNEL=="event*",    NAME="input/%k", MODE="0600"
  100. KERNEL=="js*",        NAME="input/%k", MODE="664"
  101. KERNEL=="ts*",        NAME="input/%k", MODE="0600"
  102.  
  103. # loop devices
  104. KERNEL=="loop[0-9]*",    NAME="loop/%n", SYMLINK+="%k", GROUP="disk"
  105.  
  106. # md block devices
  107. KERNEL=="md[0-9]*",    NAME="md/%n", SYMLINK+="%k", GROUP="disk"
  108.  
  109. # aoe char devices,
  110. SUBSYSTEM=="aoe", KERNEL=="discover",    NAME="etherd/%k", GROUP="disk", MODE="0220"
  111. SUBSYSTEM=="aoe", KERNEL=="err",    NAME="etherd/%k", GROUP="disk", MODE="0440"
  112. SUBSYSTEM=="aoe", KERNEL=="interfaces",    NAME="etherd/%k", GROUP="disk", MODE="0220"
  113.  
  114. # misc devices
  115. KERNEL=="agpgart",    NAME="misc/%k", SYMLINK+="%k"
  116. KERNEL=="psaux",    NAME="misc/%k", SYMLINK+="%k"
  117. KERNEL=="rtc",        NAME="misc/%k", SYMLINK+="%k", MODE="0664"
  118. KERNEL=="uinput",    NAME="misc/%k", SYMLINK+="%k"
  119. KERNEL=="inotify",    NAME="misc/%k", SYMLINK+="%k", MODE="0666"
  120.  
  121. # netlink devices
  122. KERNEL=="route",    NAME="netlink/%k"
  123. KERNEL=="skip",        NAME="netlink/%k"
  124. KERNEL=="usersock",    NAME="netlink/%k"
  125. KERNEL=="fwmonitor",    NAME="netlink/%k"
  126. KERNEL=="tcpdiag",    NAME="netlink/%k"
  127. KERNEL=="nflog",    NAME="netlink/%k"
  128. KERNEL=="xfrm",        NAME="netlink/%k"
  129. KERNEL=="arpd",        NAME="netlink/%k"
  130. KERNEL=="route6",    NAME="netlink/%k"
  131. KERNEL=="ip6_fw",    NAME="netlink/%k"
  132. KERNEL=="dnrtmsg",    NAME="netlink/%k"
  133. KERNEL=="tap*",        NAME="netlink/%k"
  134.  
  135. # network devices
  136. KERNEL=="tun",        NAME="net/%k",    MODE="0600"
  137.  
  138. # ramdisk devices
  139. KERNEL=="ram[0-9]*",    NAME="rd/%n", SYMLINK+="%k"
  140.  
  141. # IEEE1394 (firewire) devices (must be before raw devices below)
  142. KERNEL=="raw1394",    NAME="%k",        GROUP="video"
  143. KERNEL=="dv1394*",    NAME="dv1394/%n",    GROUP="video"
  144. KERNEL=="video1394*",    NAME="video1394/%n",    GROUP="video"
  145.  
  146. # raw devices
  147. KERNEL=="raw[0-9]*",    NAME="raw/%k", GROUP="disk"
  148. KERNEL=="ram*",        NAME="%k", GROUP="disk"
  149.  
  150. # sound devices
  151. KERNEL=="adsp",            NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
  152. KERNEL=="adsp[0-9]*",        NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
  153. KERNEL=="audio",        NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
  154. KERNEL=="audio[0-9]*",        NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
  155. KERNEL=="dsp",            NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
  156. KERNEL=="dsp[0-9]*",        NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
  157. KERNEL=="mixer",        NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
  158. KERNEL=="mixer[0-9]*",        NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
  159. KERNEL=="sequencer",        NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
  160. KERNEL=="sequencer[0-9]*",    NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
  161.  
  162. # memory devices
  163. KERNEL=="random",    NAME="%k", MODE="0666"
  164. KERNEL=="urandom",    NAME="%k", MODE="0444"
  165. KERNEL=="mem",        NAME="%k", MODE="0640"
  166. KERNEL=="kmem",        NAME="%k", MODE="0640"
  167. KERNEL=="port",        NAME="%k", MODE="0640"
  168. KERNEL=="full",        NAME="%k", MODE="0666"
  169. KERNEL=="null",        NAME="%k", MODE="0666"
  170. KERNEL=="zero",        NAME="%k", MODE="0666"
  171.  
  172. # usb devices
  173. KERNEL=="hiddev*",        NAME="usb/%k"
  174. KERNEL=="auer*",        NAME="usb/%k"
  175. KERNEL=="legousbtower*",    NAME="usb/%k", GROUP="usb"
  176. KERNEL=="dabusb*",        NAME="usb/%k"
  177. BUS=="usb", KERNEL=="lp[0-9]*",    NAME="usb/%k", GROUP="lp"
  178.  
  179. # v4l devices
  180. KERNEL=="video[0-9]*",    NAME="v4l/video%n", SYMLINK+="video%n", GROUP="video"
  181. KERNEL=="radio[0-9]*",    NAME="v4l/radio%n", SYMLINK+="radio%n", GROUP="video"
  182. KERNEL=="vbi[0-9]*",    NAME="v4l/vbi%n", SYMLINK+="vbi%n", GROUP="video"
  183. KERNEL=="vtx[0-9]*",    NAME="v4l/vtx%n", GROUP="video"
  184.  
  185. # dvb devices
  186. SUBSYSTEM=="dvb", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}'", NAME="%c", GROUP="video"
  187.  
  188. # Asterisk Zaptel devices
  189. KERNEL=="zapctl",    NAME="zap/ctl"
  190. KERNEL=="zaptimer",    NAME="zap/timer"
  191. KERNEL=="zapchannel",    NAME="zap/channel"
  192. KERNEL=="zappseudo",    NAME="zap/pseudo"
  193. KERNEL=="zap[0-9]*",    NAME="zap/%n"
  194.  
  195. # pilot/palm devices
  196. KERNEL=="pilot",    NAME="%k", GROUP="uucp"
  197.  
  198. # jaz devices
  199. KERNEL=="jaz*",        NAME="%k", GROUP="disk"
  200.  
  201. # zip devices
  202. KERNEL=="pocketzip*",    NAME="%k", GROUP="disk"
  203. KERNEL=="zip*",        NAME="%k", GROUP="disk"
  204.  
  205. # ls120 devices
  206. KERNEL=="ls120",    NAME="%k", GROUP="disk"
  207.  
  208. # lp devices
  209. KERNEL=="lp*",        NAME="%k", GROUP="lp"
  210. KERNEL=="irlpt",    NAME="%k", GROUP="lp"
  211. KERNEL=="usblp",    NAME="%k", GROUP="lp"
  212. KERNEL=="lp*",        NAME="%k", GROUP="lp"
  213.  
  214. # tape devices
  215. KERNEL=="ht*",        NAME="%k", GROUP="tape"
  216. KERNEL=="nht*",        NAME="%k", GROUP="tape"
  217. KERNEL=="pt*",        NAME="%k", GROUP="tape"
  218. KERNEL=="npt*",        NAME="%k", GROUP="tape"
  219. KERNEL=="st*",        NAME="%k", GROUP="tape"
  220. KERNEL=="nst*",        NAME="%k", GROUP="tape"
  221. KERNEL=="osst*",    NAME="%k", GROUP="tape"
  222. KERNEL=="nosst*",    NAME="%k", GROUP="tape"
  223.  
  224. # diskonkey devices
  225. KERNEL=="diskonkey*",    NAME="%k", GROUP="disk"
  226.  
  227. # rem_ide devices
  228. KERNEL=="microdrive*",    NAME="%k", GROUP="disk"
  229.  
  230. # kbd devices
  231. KERNEL=="kbd",        NAME="%k", MODE="0664"
  232.  
  233. # Sony Vaio Jogdial sonypi device
  234. KERNEL=="sonypi",    NAME="%k", MODE="0666"
  235.  
  236. # packet devices
  237. KERNEL=="pktcdvd",        NAME="pktcdvd/control", GROUP="cdrw", MODE="0660"
  238. KERNEL=="pktcdvd[0-9]*",    NAME="pktcdvd/pktcdvd%n", GROUP="cdrw", MODE="0660"
  239.  
  240. # infiniband devices
  241. KERNEL=="umad*",    NAME="infiniband/%k"
  242. KERNEL=="issm*",    NAME="infiniband/%k"
  243.  
  244. # tpm devices
  245. KERNEL=="tpm*",    NAME="%k", OWNER="tss", GROUP="tss", MODE="0600"
  246.  
  247. #######################################
  248. # Persistant block device stuff - begin
  249. #######################################
  250.  
  251. # Skip all of this if we are not adding a block device
  252. ACTION!="add",        GOTO="persistent_end"
  253. SUBSYSTEM!="block",    GOTO="persistent_end"
  254. KERNEL=="ram*|loop*|fd*|nbd*",    GOTO="persistent_end"
  255.  
  256. # skip accessing removable ide devices, cause the ide drivers are horrible broken
  257. BUS=="ide", SYSFS{removable}="1", GOTO="no_volume_id"
  258. BUS=="ide", SYSFS{../removable}="1", GOTO="no_volume_id"
  259.  
  260. # persistent disk device links /dev/disk/
  261. KERNEL=="hd*[!0-9]", IMPORT="/sbin/ata_id --export $tempnode"
  262. KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}"
  263. KERNEL=="hd*[0-9]", IMPORT{parent}=="ID_*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n"
  264.  
  265. KERNEL=="sd*[!0-9]", SYSFS{ieee1394_id}=="*", IMPORT="/bin/echo -e 'ID_SERIAL=$sysfs{ieee1394_id}\nID_BUS=ieee1394'"
  266. KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="", IMPORT="/sbin/usb_id -x"
  267. KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="", IMPORT="/sbin/scsi_id -g -x -s %p -d %N"
  268. KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="", IMPORT="/sbin/scsi_id -g -x -a -s %p -d %N"
  269. KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
  270. KERNEL=="sd*[0-9]", IMPORT{parent}=="ID_*"
  271. KERNEL=="sd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
  272.  
  273. # Skip id for ram / loop / fd
  274. KERNEL=="ram*", GOTO="no_volume_id"
  275. KERNEL=="loop*", GOTO="no_volume_id"
  276. KERNEL=="fd*", GOTO="no_volume_id"
  277.  
  278. KERNEL=="*[!0-9]", ENV{ID_TYPE}=="?*", IMPORT="/sbin/path_id %p", SYMLINK+="disk/by-path/$env{ID_PATH}"
  279. KERNEL=="*[0-9]", IMPORT{parent}=="ID_*"
  280. KERNEL=="*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
  281.  
  282. # volume-label/uuid
  283. KERNEL=="*[!0-9]", SYSFS{removable}=="1", GOTO="no_volume_id"
  284. KERNEL=="sr*", GOTO="no_volume_id"
  285. KERNEL=="*[0-9]", IMPORT="/sbin/vol_id --export $tempnode"
  286. KERNEL=="*[0-9]", ENV{ID_FS_UUID}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}"
  287. KERNEL=="*[0-9]", ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}"
  288. LABEL="no_volume_id"
  289.  
  290. LABEL="persistent_end"
  291.  
  292. #####################################
  293. # Persistant block device stuff - end
  294. #####################################
  295.  
  296. # usbfs-like device nodes
  297. SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", NAME="%c", MODE="0644"
  298.  
  299.  
  300. # be backward compatible for a while with the /etc/dev.d and /etc/hotplug.d/ systems
  301. # run /etc/hotplug.d/ stuff only if we came from a hotplug event, not for udevstart
  302. ENV{UDEVD_EVENT}=="1", RUN+="/sbin/udev_run_hotplugd"
  303.  
  304. # always run /etc/dev.d/ stuff for now.
  305. RUN+="/sbin/udev_run_devd"
  306.  
  307. # debugging monitor
  308. RUN+="socket:/org/kernel/udev/monitor"
  309.